<?php

namespace App\Http\Controllers\Admin\Technical;

use App\Http\Controllers\Controller;
use App\Repositories\LoginLogRepository;
use Illuminate\Http\Request;

class LoginLogController extends Controller
{
    public function __construct(Request $request, LoginLogRepository $repository)
    {
        $this->request = $request;
        $this->repository = $repository;
    }

    public function index()
    {
        $params = $this->request->all();
        $list = $this->repository->pagination($params);
        return $this->inertia('admin/technical/logins/index', [
            'data' => $list->items(),
            'pagination' => [
                'total' => $list->total(),
                'page' => $list->currentPage(),
                'pageSize' => $list->perPage(),
            ],
            'filters' => $params,
            'title' => '登录日志',
        ]);
    }
}

